package svc

import (
	"github.com/zeromicro/go-zero/zrpc"
	"week2_zg6/bookApi/internal/config"
	"week2_zg6/bookRpc/book"
	"week2_zg6/bookRpc/bookclient"
)

type ServiceContext struct {
	Config config.Config
	Book   book.BookClient
}

func NewServiceContext(c config.Config) *ServiceContext {
	return &ServiceContext{
		Config: c,
		Book:   bookclient.NewBook(zrpc.MustNewClient(c.Book)),
	}
}
